<%@ page language="java" contentType="text/html; charset=utf-8"  pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>

<script type="text/javascript">
	$(function() {
		validReg("addForm");
	});
</script>

<div class="page-content" ms-controller="logInquiryPage">
		<!--content-->
		<div class="monitor">
			<div class="monitorLeft">
				<div class="form-group">
					<label  class="col-sm-4 control-label">被查人姓名：</label>
					<div class="col-sm-7 ">
						<div class="pr">
							<input type="text" name="userName" class="form-control" placeholder="" :duplex="searchModel.userName"/>								
						</div>
					</div>
				</div>
				<div class="form-group dateContainer">
					<label class="col-sm-4 control-label">开始时间：</label>
					<div class="col-sm-7 ">
						<div class="pr">
							<input id="beginTimeStr" name="beginTimeStr" type="text"
								class="form-control datepicker" placeholder=""
								:duplex="searchModel.beginTimeStr">
						</div>
					</div>
				</div>
				
				<div class="form-group">
					<label  class="col-sm-4 control-label">证件号：</label>
					<div class="col-sm-7 ">
						<div class="pr">
							<input name="cardNum" type="text" class="form-control" placeholder="" :duplex="searchModel.cardNum"/>								
						</div>
					</div>
				</div>
				
				<div class="form-group">
					<label class="col-sm-4 control-label">结束时间：</label>
					<div class="col-sm-7 ">
						<div class="pr">
							<input id="endTimeStr" name="endTimeStr" type="text"
								class="form-control datepicker" placeholder=""
								:duplex="searchModel.endTimeStr">
						</div>
					</div>
				</div>
				
				<div class="form-group">
					<label class="col-sm-4 control-label">查询结果：</label>
					<div class="col-sm-7 ">
						<select id="queryResult" name="queryResult" class="form-control input-sm"
							:duplex="searchModel.queryResult">
							<option ms-for="el in @inquiryResults" ms-attr="{value: el.status}">{{el.name}}</option>
						</select>
					</div>
				</div>
				<div class="form-group">
					<label  class="col-sm-4 control-label">查询人账号：</label>
					<div class="col-sm-7 ">
						<input id="account" name="account" type="text" class="form-control"
								placeholder="" :duplex="searchModel.account" />
					</div>
				</div>
				
			</div>
			
			<div class="monitorRight">
				<a href="javascript:void(0);" ms-click="search" class="btnSearch" :click="@search">查询</a>
				 <a href="javascript:void(0);" class="btnSearch grey" style="margin-left: 10px;" :visible="false">导 出</a>
			</div>
			
		</div>
		<div class="clearfix"></div>
		<div class="portlet-body">
			<div class="table-scrollable">
				<table class="table table-condensed flip-content">
					<thead class="flip-content">
						<tr>
							<th width="10%">被查人员</th>
							<th width="15%">身份证号</th>
							<th width="15%">查询时间</th>										
							<th width="10%">查询结果</th>
							<th width="10%">查询类型</th>
							<th width="15%">报告编号</th>
							<th width="10%">操作人</th>
							<th width="10%" class="text-center">操作</th>
						</tr>
					</thead>
					<tbody id="select_tbody">
					  <c:if test="${result.code eq 'SUCCESS' }">
						<c:forEach items="${result.data.rows}" var="row" varStatus="status">
							<tr>
								<td width="10%" class="">${row.userName}</td>
								<td width="15%" class="">${row.cardNum }</td>
								<td width="15%" class=""><fmt:formatDate value="${row.createTime }"	pattern="yyyy-MM-dd HH:mm:ss" /></td>
								<td width="10%" class="">
								   <c:if test="${row.queryResult eq '0' }">
								            未完成
								   </c:if>
								   <c:if test="${row.queryResult eq '2' }">
								            已完成
								   </c:if>
								</td>
								<td width="10%" class="">
								    <c:choose>
								        <c:when test="${row.inquiryType eq 1 }">
								          	个人查询     
								        </c:when>
								        <c:when test="${row.inquiryType eq 2 }">
								          	代理查询     
								        </c:when>
								        <c:when test="${row.inquiryType eq 3 }">
								          	司法查询     
								        </c:when>
								        <c:otherwise>
								        
								        </c:otherwise>
								    </c:choose>
								    
								
								</td>
								<td width="15%" class="">${row.reportCode }</td>
								<td width="10%" class="">${row.account }</td>
								<td width="10%" class="text-center">
								   <c:if test="${! empty row.inquiryId }">
									  <a href="javascript:void(0);" class="a-detial" :click="@detail('${row.inquiryId }')">详情</a>
								   </c:if>
								   <c:if test="${empty row.inquiryId }">
									  <a href="javascript:void(0);" class="a-detial" :click="@detail('${row.inquiryId }')">---</a>
								   </c:if>
								</td>
							</tr>
						</c:forEach>
					  </c:if>						
					</tbody>
				</table>
			</div>
		</div>
		
		
		
		<!--end content-->
	</div>
	
	<c:if test="${result.code eq 'SUCCESS' }">

	<script type="text/javascript">
		Page.navigation('page', 'log/inquiry/page', 'log:page',
				'${result.data.pageSize}', '${result.data.total}',
				'${result.data.pageCount}', '${result.data.currPage}',
				'menuUrl');
	</script>

	<div id="page" class="page"></div>

</c:if>
	
<script
	src="resources/js/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js"></script>
<script
	src="resources/js/bootstrap-datepicker/dist/locales/bootstrap-datepicker.zh-CN.min.js"></script>
<link rel="stylesheet"
	href="resources/js/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css" />
<script src="resources/js/app/log.js"></script>